package adapter.example;

/**
 * 相当于adapter。内部维护了一个ForeignCenter，兼容了不适配的接口
 * @author Chen Guang
 * @date 2019/4/16 0016 下午 15:27
 */
public class Translator extends Player{

    private ForeignCenter center;

    public Translator(String name) {
        super(name);
        this.center = new ForeignCenter(name);
    }

    @Override
    public void attack() {
        center.进攻();
    }

    @Override
    public void defence() {
        center.防守();
    }
}
